feat(DynamicElement): support html attribute#6561
Merged
Conversation
Contributor
Reviewer's GuideThis PR refactors key components to use explicit RenderTreeBuilder implementations—enabling support for arbitrary HTML attributes—and removes the DynamicElement wrapper in favor of native HTML elements with direct @OnClick bindings. Class diagram for refactored LinkButton and BootstrapInputGroupLabel componentsclassDiagram
class ButtonBase {
}
class LinkButton {
+string Url
+string Target
+bool Disabled
+string Icon
+string ImageUrl
+string Text
+RenderFragment ChildContent
+BuildRenderTree(RenderTreeBuilder builder)
-OnClickButton()
}
ButtonBase <|-- LinkButton
class DisplayBase~T~ {
}
class BootstrapInputGroupLabel {
+string? ClassString
+string? StyleString
+bool Required
+string? DisplayText
+BuildRenderTree(RenderTreeBuilder builder)
+OnParametersSet()
}
DisplayBase <|-- BootstrapInputGroupLabel
Class diagram for removal of DynamicElement usage in componentsclassDiagram
class DynamicElement {
-string TagName
-EventCallback OnClick
-bool TriggerClick
-RenderFragment ChildContent
}
%% DynamicElement is no longer used in CardUpload, MultiSelect, MultiSelectGeneric, DatePickerBody, and ContextMenu
class CardUpload {
-OnCardFileDelete()
}
class MultiSelect {
-SelectAll()
-InvertSelect()
-Clear()
}
class MultiSelectGeneric {
-SelectAll()
-InvertSelect()
-Clear()
}
class DatePickerBody {
-SwitchView()
-SwitchTimeView()
}
class ContextMenu {
-OnClickItem()
}
%% DynamicElement is removed from these components
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey @ArgoZhang - I've reviewed your changes - here's some feedback:
- Custom BuildRenderTree implementations (e.g., in LinkButton and BootstrapInputGroupLabel) should call builder.AddMultipleAttributes to forward AdditionalAttributes so consumers can supply arbitrary HTML attributes.
- A few DynamicElement usages lost their TagName parameter (for example in ContextMenu), so double-check you’re still rendering the intended HTML element instead of relying on the default.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Custom BuildRenderTree implementations (e.g., in LinkButton and BootstrapInputGroupLabel) should call builder.AddMultipleAttributes to forward AdditionalAttributes so consumers can supply arbitrary HTML attributes.
- A few DynamicElement usages lost their TagName parameter (for example in ContextMenu), so double-check you’re still rendering the intended HTML element instead of relying on the default.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6561 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 721 719 -2
Lines 31520 31560 +40
Branches 4449 4450 +1
=========================================
+ Hits 31520 31560 +40
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This was referenced Aug 15, 2025
This was referenced Aug 22, 2025
This was referenced Aug 29, 2025
This was referenced Sep 8, 2025
This was referenced Sep 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link issues
fixes #6560
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Simplify component rendering by migrating DynamicElement-based wrappers to direct HTML elements and upgrading LinkButton and InputGroupLabel components to use manual render trees for full HTML attribute support and consistent event handling
New Features:
Enhancements: